package cn.jason.util;

import com.sleepycat.je.DatabaseConfig;

/**
 * BerkerleyDB工具类.
 *
 * @author cnJason
 */
public class BerkeleyDBUtils {
    //默认配置.
    public static DatabaseConfig defaultDBConfig;

    static {
        //项目启动时初始.
        defaultDBConfig = createDefaultDBConfig();
    }

    /**
     * 创建默认的DB.
     *
     * @return
     */
    public static DatabaseConfig createDefaultDBConfig() {
        DatabaseConfig databaseConfig = new DatabaseConfig();
        //设置允许创建
        databaseConfig.setAllowCreate(true);
        //设置延迟写.
        databaseConfig.setDeferredWrite(true);
        return databaseConfig;
    }
}
